feat: add RPM packaging and Packit CI/CD for complytime-providers#5
feat: add RPM packaging and Packit CI/CD for complytime-providers#5marcusburghardt wants to merge 2 commits intocomplytime:mainfrom
Conversation
Add Fedora RPM spec that builds from a single source package and produces two binary sub-packages: - complytime-providers-openscap (requires complyctl, scap-security-guide) - complytime-providers-ampel (requires complyctl) No main binary RPM is produced. Follows Fedora Packaging Guidelines for Go projects with vendored dependencies. Uses vendor/modules.txt via %license for automatic bundled provides generation. rpmlint passes with 0 errors, 0 warnings. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Add Packit configuration with: - COPR builds on PRs (Fedora rawhide/43/42, CentOS Stream 9/10) - Testing Farm tests on PRs via TMT plans - propose_downstream on release (rawhide, f43, f42) - Koji builds and Bodhi updates on dist-git commits Add FMF metadata root and TMT test plan that validates both provider binaries are installed at the expected path with executable permissions after RPM installation. packit validate confirms configuration is valid. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
hbraswelrh
left a comment
There was a problem hiding this comment.
Review Council Findings (Imperative)
Five issues that need to be fixed before merge — build failures, factual errors, or Fedora packaging guideline violations.
1. complytime-providers.spec line 39: HealthCheck RPC does not exist
The provider interface defines Describe, Generate, and Scan. There is no HealthCheck RPC. The Describe RPC returns a DescribeResponse that includes a Healthy field, but the RPC itself is Describe.
-Communicates via gRPC (Generate, Scan, HealthCheck RPCs)
+Communicates via gRPC (Describe, Generate, Scan RPCs)2. complytime-providers.spec lines 66-67: Add -mod=vendor to %build
%check (line 77) uses -mod=vendor but %build does not. In network-isolated Koji/mock builds, if vendor auto-detection fails the build breaks — or worse, build and test phases resolve different dependency versions silently.
-go build -buildmode=pie -o ${GO_BUILD_BINDIR}/complyctl-provider-openscap ./cmd/openscap-provider
-go build -buildmode=pie -o ${GO_BUILD_BINDIR}/complyctl-provider-ampel ./cmd/ampel-provider
+go build -mod=vendor -buildmode=pie -o ${GO_BUILD_BINDIR}/complyctl-provider-openscap ./cmd/openscap-provider
+go build -mod=vendor -buildmode=pie -o ${GO_BUILD_BINDIR}/complyctl-provider-ampel ./cmd/ampel-provider3. complytime-providers.spec: Missing ExclusiveArch: %{go_arches}
Without this, Koji will attempt builds on all Fedora architectures (s390x, ppc64le, etc.) once propose_downstream lands the spec in dist-git. This is required by Fedora Go packaging guidelines.
Add after the BuildRequires lines:
ExclusiveArch: %{go_arches}
4. complytime-providers.spec line 16: Missing minimum Go version
go.mod declares go 1.25.0 but BuildRequires: golang has no version floor. On targets shipping older Go (e.g., CentOS Stream 9), the build will fail with cryptic compilation errors instead of a clear dependency resolution failure.
-BuildRequires: golang
+BuildRequires: golang >= 1.25.05. complytime-providers.spec lines 83, 88: vendor/modules.txt under %license
vendor/modules.txt is a Go module manifest, not a license file. The %license macro is reserved for files containing license text per Fedora packaging guidelines. This will be flagged by license auditing tools.
-%license LICENSE vendor/modules.txt
-%doc README.md
+%license LICENSE
+%doc README.md vendor/modules.txt(Apply to both the openscap and ampel %files sections.)
hbraswelrh
left a comment
There was a problem hiding this comment.
This review supersedes the previous "Review Council Findings (Imperative)" review above.
Code Review
Issues
Bug: Missing runtime dependency openscap-scanner
The openscap sub-package requires scap-security-guide but not openscap-scanner. The provider binary invokes oscap via exec.Command at runtime — without openscap-scanner installed, every scan will fail with "command not found".
Worth discussing: Missing runtime dependencies for Ampel provider
The ampel sub-package has no Requires for snappy and ampel, both called via exec.Command at runtime. If these aren't packaged in Fedora, the dependency can't be expressed as an RPM requirement, but it should be documented in the sub-package %description.
Minor: vendor/modules.txt listed as %license
This file is a Go module manifest, not a license. Per Fedora Go packaging guidelines, it should be consumed by %golist to generate Provides: bundled(golang(...)) entries. Without that, the RPMs will lack bundled() provides metadata — a Fedora packaging review blocker.
Minor: Build flags not fully applied
%set_build_flags sets CFLAGS/LDFLAGS, but the go build commands don't forward $LDFLAGS via -ldflags. Security hardening is partially ineffective. Using %gobuild or passing -ldflags "${LDFLAGS}" would address this.
Trivial: .fmf/version missing trailing newline
Observations
- Tests in
%checkmay require external tools not available in mock/koji build environments. Verify tests have proper skip conditions. - CentOS Stream 9 ships Go 1.21 by default, but
go.modspecifiesgo 1.25.0— likely build failures on that target. - The test plan only checks binary existence. A smoke test (e.g.,
--help) would catch dynamic linking issues earlier.
Summary
Add complete Fedora RPM packaging pipeline for complytime-providers. A single source RPM produces two binary sub-packages so users can install only the providers they need:
No main
complytime-providersbinary RPM is produced.Files added:
vendor/modules.txt, and unit tests in%check/usr/libexec/complytime/providers/with executable permissionsCompanion PR: complytime/complyctl#485 (complyctl side — spec simplification, GoReleaser cleanup, release docs)
Related Issues
complytime-providers(manual, one-time)Review Hints
Review the two commits in sequence:
feat:): thecomplytime-providers.specfile with sub-package definitionsci:): Packit configuration, FMF metadata, and TMT test planBoth
rpmlint complytime-providers.specandpackit validatepass with zero errors. Thepackit validatewarning about the package not existing is expected — it requires a Fedora package review first.To build and test the RPM locally:
Alternatively:
packit build locallyThe
Requires: complyctl >= 0.0.8version is a placeholder — it should be set to the first complyctl release that includes the provider SDK rename (pkg/provider/).There is a simple release JOB in the workflow, but it is expected to be changed when integrating with Fedora.